package com.hb.exception;


public enum HbExcetionEnum {

    /**
     * 鉴权异常
     */
    NOT_LOG_IN(1001,"Please log in first"),

    NO_PERMISSION(1002,"Sorry, you do not have permission"),

    WRONG_PASSWORD(1003,"Incorrect username or password"),

    WRONG_USERNAME(1004,"Incorrect username or password"),

    REDIS_NO_KEY(1005,"Login has expired, please log in again!"),

    TOO_MUCH_ERROR(1006,"The account password has been entered incorrectly more than 5 times, and the account has been locked. Please contact the administrator to unlock it!"),

    VERIFICATION_ERROR(1007,"Incorrect verification code!"),

    ACCOUNT_DISABLED(1008, "The account has been deactivated. Please contact the administrator!"),

    ACCOUNT_LOCKED(1009, "The account has been locked, please contact the administrator!"),

    ANOTHER_ONE(1010,"Your account is logged in on another device. If it is not operated by yourself, please change your password immediately!"),

    WRONG_TOKEN(1011,"Incorrect token or token has expired"),

    UPDATE_ERROR(1012,"Account update failed, please contact the administrator!"),

    USERNAME_EXISTS(1013,"Username already exists!"),

    CRYPTO_EXCEPTION(1014,"RSA decryption exception!"),
    /**
     * System exception
     */
    RUN_ERROR(2000,"Run exception"),

    SYSTEM_ERROR(2000,"System run error"),

    TOO_LONG(2001,"Database error"),

    IS_EXIT(2002,"The record already exists in the database!"),

    //foreign key exception
    INCORRECT_DATA(2003,"Data error!"),

    // Business data error!
    ERROR_DATA(2004, "Data error，please contact the administrator!"),

    /**
     * param exception
     */
    TYPE_MISMATCH(4001,"Parameter type mismatch"),

    INCORRECT_PARAMETERS(4004,"Parameter error"),

    REQUEST_TYPE_ERROR(4005, "Request method exception"),

    NOT_MATCH(4006, "Incorrect parameter format"),

    /**
     * api接口异常
     */
    JSON_EXCEPTION(5001,"Incorrect data format"),

    API_TIME_OUT(5002,"The request has timed out, please try again later"),
    ;

    private int code;
    private String msg;

    HbExcetionEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }


}
